<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head class="am-topbar am-topbar-inverse admin-header">
<jsp:include page="/commonPages/admin-meta.jsp" flush="true" />
<!-- CSS files -->
<jsp:include page="/commonPages/admin-style.jsp" flush="true" />

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>我的申请</title>
<script src="<%=request.getContextPath()%>/js/jquery.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/page.js"></script>

<script src="<%=request.getContextPath()%>/js/bootstrap.min.js"></script>
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/assets/css/amazeui.min.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/assets/css/admin.css">
</head>
<script type="text/javascript">
	
	function getMaterial(flowId,flowName){
	
		$.ajax({
			contentType :"application/x-www-form-urlencoded;charset=utf-8",
            url : "user/getMaterial",
            type : "post",
            data : {
            	flowId : flowId,
            	flowName : flowName,
            },
		    success : function(data) {
            	if(data == "material")
            		window.location.href = "getMaterial.jsp";
            }
     });
	}
</script>
<body  onLoad="goPage(1,10);">


	<div id="wrapper">

		<!-- Navigation -->
		<jsp:include page="/commonPages/admin-navigator.jsp" flush="true" />

		<!-- Page Content -->
		<div id="page-wrapper">


			<div class="modal-body">
				<div class="row">
					<form id="formInput" class="form-horizontal" role="form">
						<div class="tabbable" id="tabs-437698">
							<ul class="nav nav-tabs">
							
							<li class="active"><a href="#panel-636968"
									data-toggle="tab" class="size" style="color: black">提交申请</a></li>
							
								<li ><a href="#panel-636967"
									data-toggle="tab" class="size" style="color: black">正在申请</a></li>
								
								<li><a href="#panel-561340" data-toggle="tab" class="size"
									style="color: black">申请成功</a></li>
							</ul>
							<div class="tab-content">
								<div class="tab-pane" id="panel-561340">
									<div class="am-cf admin-main">
										<div class="admin-content">
											<div class="am-g">
												<div class="am-u-sm-12">
													<table
														class="am-table am-table-striped am-table-hover table-main">
														<thead>
															<tr>
																<th class="table-id">序号</th>
																<th class="table-title">申请名称</th>
																<th class="table-type">申请项目</th>
																<th class="table-date am-hide-sm-only">开始时间</th>
																<th class="table-date am-hide-sm-only">结束时间</th>
																<th class="table-set">操作</th>
															</tr>
														</thead>
														<tbody>
															<c:forEach var="list" items="${lists}" varStatus="status">
																<tr>
																	<td class="am-hide-sm-only">${requestScope.offset+status.index+1}</td>
																	<td class="am-hide-sm-only">${list.programName }</td>
																	<td class="am-hide-sm-only">${list.type }</td>
																	<td class="am-hide-sm-only">${list.startTime }</td>
																	<td class="am-hide-sm-only">${list.endTime }</td>
																	<td class="am-hide-sm-only"><a
	href="./process/getMyMaterial?processInstanceId=${list.proInstId}">查看</a>
																		
																	</td>
																</tr>
															</c:forEach>
														</tbody>
													</table>
												</div>
											</div>
										</div>
									</div>
								</div>
								<div class="tab-pane " id="panel-636967">
									<div class="am-cf admin-main">
										<div class="admin-content">
											<div class="am-g">
												<div class="am-u-sm-12">
													<table
														class="am-table am-table-striped am-table-hover table-main">
														<thead>
															<tr>
																<th class="table-id">序号</th>
																<th class="table-title">申请名称</th>
																<th class="table-type">申请项目</th>
																<th class="table-date am-hide-sm-only">申请时间</th>
																<th class="table-set">操作</th>
															</tr>
														</thead>
														<tbody>
															<c:forEach var="apply" items="${applyList}"
																varStatus="status">
																<tr>
																	<td class="am-hide-sm-only">${requestScope.offset+status.index+1}</td>
																	<td class="am-hide-sm-only">${apply.proName }</td>
																	<td class="am-hide-sm-only">${apply.type }</td>
																	<td class="am-hide-sm-only">${apply.time }</td>
																	<td class="am-hide-sm-only"><a
																		href="./diagram.jsp?processInstanceId=${apply.proInstId }">流程跟踪</a>
																		<a
																		href="./process/getMyMaterial?processInstanceId=${apply.proInstId}">查看</a>
																		<a
																		href="./process/myTask?taskType=candidate">任务</a>
																	</td>
																</tr>
															</c:forEach>
														</tbody>
													</table>
												</div>
											</div>
										</div>
									</div>
								</div>
								
								<div class="tab-pane active" id="panel-636968">
									<div class="am-cf admin-main">
  <div class="admin-content">
      <div class="am-g">
        <div class="am-u-sm-12">
            <table class="am-table am-table-striped am-table-hover table-main" id="mytable">
              <thead id="tb_head">
	              <tr>
	              	<th class="table-check"><input type="checkbox" /></th>
	                <th class="table-id">编号</th>
					<th class="table-title">流程名称</th>
					<th class="table-set">操作</th>
	              </tr>
	              </thead>
              <tbody>
              <c:forEach var="flow" items="${sessionScope.flowList}">
              	<tr>
                <td><input type="checkbox" /></td>
                <td id="flowId">${flow.flowId }</td>
                <td class="am-hide-sm-only" id="flowName">${flow.flowName }</td>
                <td>
                	<div class="am-btn-toolbar">
		                <div class="am-btn-group am-btn-group-xs">
						 <input type="button" class="btn" onClick="getMaterial('${flow.flowId }','${flow.flowName }')" value="上传"/>
						</div>
					</div> 
                </td>
              </tr>
              </c:forEach>
              </tbody>
            </table>
           <table width="60%" align="right" margin-top="0">
        	<tr><td><div id="barcon"></div></td></tr>
    	   </table>
            <hr />
        </div>

      </div>
    </div>

  </div>
								</div>
								
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
	<jsp:include page="/commonPages/admin-script.jsp" flush="true" />

</body>
</html>